package servlet.user;

import service.Impl.PetServiceImpl;
import service.PetService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/user/petShow")
public class PetShowServlet extends HttpServlet {
    private PetService petService = new PetServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        req.setAttribute("petList", petService.findAll());
        req.setAttribute("petNoList", petService.findNoPet());
        req.getRequestDispatcher("/user/show.jsp").forward(req, resp);
    }
}